<template>
  <div class="ac-menu">
    <div class="menu-item no-padding">
      <span class="item head">科技创新</span>
      <span class="item" v-for="(item,index) in menu" :class="{'active': $route.fullPath.includes(item.path)}" :key="index" @click="selectMenu(item, index)">{{item.name}}</span>
    </div>
    <div class="menu-item no-padding">
      <span class="item head">工程创优</span>
      <span class="item" v-for="(item,index) in menu1" :class="{'active': $route.fullPath.includes(item.path)}" :key="index" @click="selectMenu(item, index+4)">{{item.name}}</span>
    </div>
    <div class="menu-item no-padding">
      <span class="item head">星级评定</span>
      <span class="item" v-for="(item,index) in menu2" :class="{'active': $route.fullPath.includes(item.path)}" :key="index" @click="selectMenu(item, index+8)">{{item.name}}</span>
    </div>
  </div>
</template>
<script>
export default {
  name: "headBar",
  computed: {
  },
  data () {
    return {
      currentIndex: 0,
      menu: [{
        name: '科技成果评价',
        path: '/innovation/technological'
      }, {
        name: '标准化工作',
        path: '/innovation/work'
      }, {
        name: '技能竞赛',
        path: '/innovation/week'
      }, {
        name: '科技创新奖',
        path: '/innovation/create'
      }],
      menu1: [{
        name: '中国安装之星',
        path: '/innovation/star'
      }, {
        name: '优质安装工程',
        path: '/innovation/world'
      }, {
        name: '安装优质结构',
        path: '/innovation/category'
      }, {
        name: '市观摩工程',
        path: '/innovation/project'
      }],
      menu2: [{
        name: '相关文件历年展示',
        path: '/innovation/view'
      }]
    }
  },
  components: {
  },
  mounted () {
  },
  created () {
  },
  methods: {
    selectMenu (item, index) {
      // if (index == 0 && tracker.getRoles() && !tracker.getRoles().includes("3")) {
      //   this.$router.push({ path: '/login', query: { back: window.location.href } })
      //   return false
      // }
      // if (index == 3 && tracker.getRoles() && !tracker.getRoles().includes("4")) {
      //   this.$router.push({ path: '/login', query: { back: window.location.href } })
      //   return false
      // }
      this.currentIndex = index
      this.$router.push({ path: item.path })
    }
  }
}

</script>

<style lang="scss">
</style>
